

@page "/students/view/{id:even}"

@model YoYoMooc.StudentManagement.RazorPage.Pages.Students.DetailsModel
@{
    ViewData["Title"] = "学生详情页面";
    var photoPath = "~/Images/" + (Model.Student.PhotoPath ?? "noimage.png");
}



<div class="row justify-content-center m-3">

    
  
    <vc:head-count major="@Model.Student.Major" ></vc:head-count>

    @*@await  Component.InvokeAsync(typeof(HeadCountViewComponent),new { Major=MajorEnum.Mathematics })*@


    @*    @if (TempData["Message"]!=null)
    {
        <div class="col-sm-8">
            <div class="alert alert-primary">
                @TempData["Message"]
            </div>
        </div>
    }*@

    @if (Model.Message != null)
    {
        <div class="col-sm-8">
            <div class="alert alert-primary">
                @Model.Message
            </div>
        </div>
    }
 
    <div class="col-sm-8">


        <div class="card">
            <div class="card-header">
                <h1>@Model.Student.Name</h1>
            </div>

            <div class="card-body text-center">
                <img class="card-img-top" src="@photoPath" asp-append-version="true" />

                <h4>Student ID : @Model.Student.Id</h4>
                <h4>邮箱地址 : @Model.Student.Email</h4>
                <h4>专业 : @Model.Student.Major</h4>

            </div>
            <div class="card-footer text-center">
                <a asp-page="index"
                   class="btn btn-primary">返回</a>
                <a  asp-page="/Students/Edit"  asp-route-ID="@Model.Student.Id" class="btn btn-primary m-1">编辑</a>         
                             <a href="#" class="btn btn-danger">删除</a>
            </div>
        </div>
    </div>
</div>